<meta charset="UTF-8">

<h1>f12查看效果</h1>
<script src="./utils.js"></script>

<h1>输入时间距今时间</h1>
<div id="demo1"></div>
<script>
var result1 = ``

result1 += `dateFormat('2017-3-3 5:18:19') ~~~~~${dateFormat('2017-3-3 5:18:19')} <br>`
result1 += `dateFormat('2022-3-3 5:18:19') ~~~~~${dateFormat('2022-3-3 5:18:19')} <br>`
result1 += `dateFormat('2022-4-3 5:18:19') ~~~~~${dateFormat('2022-4-3 5:18:19')} <br>`
result1  += `dateFormat('2022-4-14 5:18:19') ~~~~${dateFormat('2022-4-14 5:18:19')} <br>`

document.querySelector('#demo1').innerHTML = result1
</script>

<h1>快速获取当前时间</h1>
<div id="demo2"></div>
<script>
var result2 = ''

result2 += `format('YmdHis')~~~~~${format('YmdHis')}<br>`
result2 += `format('Y-m-d H:i:s')~~~~~${format('Y-m-d H:i:s')}<br>`
result2 += `format('Y-m-d ')~~~~~${format('Y-m-d ')}<br>`

document.querySelector('#demo2').innerHTML = result2
</script>


<h1>随机获取一个十六进制颜色</h1>
<div id="demo3"></div>
<script>
var result3 = ''

result3 += `randomColor()~~~~~~~~~~${randomColor()}<br>`
result3 += `randomColor()~~~~~~~~~~${randomColor()}<br>`
result3 += `randomColor()~~~~~~~~~~${randomColor()}<br>`

document.querySelector('#demo3').innerHTML = result3
</script>


<h1>判断是否是微信浏览器</h1>
<div id="demo4"></div>
<script>
var result4 = ''

result4 += `wx()~~~~~~~~~~${wx()}<br>`

document.querySelector('#demo4').innerHTML = result4
</script>

<h1>判断浏览器在PC端还是移动端打开</h1>
<div id="demo5"></div>
<script>
var result5 = ''

result5 += ` duankou()~~~~~~~~~~${ duankou()}<br>`

document.querySelector('#demo5').innerHTML = result5
</script>

<h1>判断使用的什么浏览器</h1>
<div id="demo6"></div>
<script>
var result6 = ''

result6 += `web()~~~~~~~~~~${web()}<br>`

document.querySelector('#demo6').innerHTML = result6
</script>

<h1>获取CSS样式兼容性问题解决代码</h1>
<div id="demo7" style="background-color: #2df573;"></div>
<script>
var result7 = ''
result7 += `getstyle(div,background-color)~~~~~~~~~~${getstyle(document.querySelector('#demo7'),"background-color")} <br>`
document.querySelector('#demo7').innerHTML += result7
</script>